from typing import Any

from aiogram.enums import ParseMode
from aiogram.types import Message
from fluent.runtime import FluentLocalization

from recruit_bot.core.pareser_data import parser_state_data


async def send_user_info(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('info_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_position(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('position_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_salary(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('salary_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_contact(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('contact_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_work(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('work_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_skills(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('skills_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_about_us(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('about_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_education(message: Message, l10n: FluentLocalization) -> None:
    await message.answer(
        l10n.format_value('education_cv'),
        parse_mode=ParseMode.HTML
    )


async def send_cv(
        message: Message,
        l10n: FluentLocalization,
        data: dict[str, Any]
) -> None:
    await message.answer(
        l10n.format_value(
            'end_cv',
            {'cv': parser_state_data(data)}
        ),
        parse_mode=ParseMode.HTML
    )
